import request, { baseUrl } from '../../api/request';

//获取公共下拉
export const getPaymentCfg = data => {
	return request({
		url: '/admin/common/getPaymentCfg',
		method: 'get',
		params: data
	});
};

//付款申请
export const paymentApply = data => {
	return request({
		url: '/admin/payment/apply',
		method: 'post',
		data: data
	});
};


//申请列表
export const paymentlist = data => {
	return request({
		url: '/admin/notice/getList',
		method: 'get',
		params: data
	});
};

//申请列表
export const getInfo = data => {
	return request({
		url: '/admin/notice/details/'+data.type,
		method: 'get',
		params: data
	});
};
//审批
export const approve = data => {
	return request({
		url: '/admin/notice/handle/process',
		method: 'post',
		data: data
	});
};
//审批
export const editApply = data => {
	return request({
		url: '/admin/notice/handle/edit',
		method: 'post',
		data: data
	});
};

//批量审批
export const batchHandle = data => {
	return request({
		url: '/admin/notice/batchHandle',
		method: 'post',
		data: data
	});
};

export const getBankList = data => {
	return request({
		url: '/admin/common/getFinanceCfg',
		method: 'get',
		params: data
	})
} 
export const getAccount = data => {
	return request({
		url: '/admin/common/getAccount/'+data.id,
		method: 'get',
		params: data
	})
} 


// 获取所属分类
export const categoryList = data => {
	return request({
		url: '/admin/common/getCategory',
		method: 'get',
		params: data
	})
}

export const searchSupplier = key => {
	return request({
		url: '/admin/common/getSupplier/' + key,
		method: 'get',
	})
}

export const exportToExcel = (data) => {
	return request({
		url: '/admin/notice/export',
		method: 'post',
		data
	})
}